package com.zhonghui.modlules.product.eshopService.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.eshop.service.Impl.BaseServiceImpl;
import com.zhonghui.modlules.product.eshopMapper.StoreProductAttrMapper;
import com.zhonghui.modlules.product.eshopMapper.StoreProductAttrValueMapper;
import com.zhonghui.modlules.product.eshopService.StoreProductAttrService;
import com.zhonghui.modlules.product.eshopVo.StoreProductAttr;
import com.zhonghui.modlules.product.eshopVo.StoreProductAttrValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(
        propagation = Propagation.REQUIRED,
        rollbackFor = {Exception.class}
)
public class StoreProductAttrServiceImpl  extends BaseServiceImpl<StoreProductAttrMapper, StoreProductAttr> implements StoreProductAttrService {
    @Autowired
    private StoreProductAttrValueMapper yxStoreProductAttrValueMapper;

    public StoreProductAttrValue uniqueByAttrInfo(String unique) {
        return (StoreProductAttrValue)this.yxStoreProductAttrValueMapper.selectOne((Wrapper) Wrappers.<StoreProductAttrValue>lambdaQuery().eq(StoreProductAttrValue::getUnique, unique));
    }
}
